Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Set the csi-secrets-store to have a priority class #3909

Merged
merged 5 commits into from
Oct 8, 2020

Conversation

Michael-Sinz
Copy link
Collaborator

@Michael-Sinz Michael-Sinz commented Oct 8, 2020

Daemonsets are needed to run on all nodes but in a busy cluster with dynamic scaling, it is possible to have enough pending pods from replica sets that a new node fills up before the daemonset pod is ready to be scheduled. Without priority classes, this can cause daemonsets to be pending to the pod they are bound to and can not run elsewhere.

In this change I added a priority class and use it in the daemonsets. We could look at using the priority class system-node-critical which is reserved for kubernetes system daemonsets. I don't think it is valid to use that here.

Just having a priority higher than 0 will usually address this as 99.99% of all workload pods are 0 (or below zero for the easily evicted buffer pods and such)

Reason for Change:

Issue Fixed:

Credit Where Due:

Does this change contain code from or inspired by another project?

  • No
  • Yes

If "Yes," did you notify that project's maintainers and provide attribution?

  • No
  • Yes

Requirements:

Notes:

Daemonsets are needed to run on all nodes but in a busy cluster with dynamic scaling, it is possible to have enough pending pods from replica sets that a new node fills up before the daemonset pod is ready to be scheduled.  Without priority classes, this can cause daemonsets to be pending to the pod they are bound to and can not run elsewhere.

In this change I added a priority class and use it in the daemonsets.  We could look at using the priority class system-node-critical which is reserved for kubernetes system daemonsets.  I don't think it is valid to use that here.

Just having a priority higher than 0 will usually address this as 99.99% of all workload pods are 0 (or below zero for the easily evicted buffer pods and such)
@welcome
Copy link

welcome bot commented Oct 8, 2020

💖 Thanks for opening your first pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix. Examples of commit messages with semantic prefixes: - fix: change azure disk cachingMode to ReadOnly - feat: make maximumLoadBalancerRuleCount configurable - docs: add note on AKS Engine and AKS relationship
Make sure to check out the developer guide for guidance on testing your change.

@acs-bot acs-bot added the size/S label Oct 8, 2020
@@ -282,6 +282,18 @@ status:
conditions: []
storedVersions: []
---
# A priority class for the daemonset such that they are not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you use go template comments for these lines instead of bash comments to save cloud-init data overhead? :/

E.g.:

{{/* A priority class for the daemonset such that they are not */}}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - annoying, but ok.
(We could look loading and dumping yaml in optimal form after templating such that you are sure to not have waste in general)

@jackfrancis
Copy link
Member

@Michael-Sinz and one more thing after the comment change, run make generate to generate code, and commit.

Thanks so much for this!

Michael-Sinz and others added 2 commits October 8, 2020 09:51
Change the comments such that they go away in template expansion (saves space in cloud-init)
@acs-bot acs-bot added size/M and removed size/S labels Oct 8, 2020
metadata:
name: csi-secrets-store
labels:
addonmanager.kubernetes.io/mode: EnsureExists
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this label so that kube-addon-manager would interpret this resource for loading

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - sorry I missed that.

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

{{- /* frozen out of a node due to the node filling up with "normal" */}}
{{- /* pods before the daemonset controller can get the daemonset */}}
{{- /* pods to be scheduled. */}}
apiVersion: scheduling.k8s.io/v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @aramase @chewong this change was made due to observed scheduling contention on clusters at scale (i.e., nodes coming on line but filling up so quickly that csi-secrets-store pods were not able to be scheduled via daemonset

Should we make such a change to the upstream reference specs as well?

@jackfrancis jackfrancis merged commit 0d4fffc into Azure:master Oct 8, 2020
@welcome
Copy link

welcome bot commented Oct 8, 2020

Congrats on merging your first pull request! 🎉🎉🎉

@acs-bot
Copy link

acs-bot commented Oct 8, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, Michael-Sinz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants